﻿@model IEnumerable<TruckingApplication.Dal.EntityModels.ORDER>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Order #
        </th>
        <th>
            Gross
        </th>
        <th>
            Paid
        </th>
        <th>
            Due Date
        </th>
        <th>
            Pickup City
        </th>
        <th>
            Pickup State
        </th>
        <th>
            Drop-Off City
        </th>
        <th>
            Drop-Off State
        </th>
        <th>
            Status
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.orderNum.ToString(), "Details", new { id=item.orderID })
        </td>
        <td>
            @{var gross = string.Format("{0:C}", item.gross);}
            @gross
        </td>
        <td>
            @Html.DisplayTextFor(modelItem => item.paidStatus)
        </td>
        <td>
            @{var date = item.dueDate.ToString("MM.dd.yy");}
            @date
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.pickupCity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.pickupState)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.dropOffCity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.dropOffState)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ORDER_STATUS.status)
        </td>
    </tr>
}

</table>
